//
// CFontManager.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;

public class CFontManager {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CFontManager(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CFontManager obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CFontManager(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CFontManager() {
    this(nel3dJNI.new_CFontManager(), true);
  }

  public void setMaxMemory(long mem) {
    nel3dJNI.CFontManager_setMaxMemory(swigCPtr, this, mem);
  }

  public long getMaxMemory() {
    return nel3dJNI.CFontManager_getMaxMemory(swigCPtr, this);
  }

  public CMaterial getFontMaterial() {
    long cPtr = nel3dJNI.CFontManager_getFontMaterial(swigCPtr, this);
    return (cPtr == 0) ? null : new CMaterial(cPtr, false);
  }

  public void computeString(String s, CFontGenerator fontGen, CRGBA color, long fontSize, IDriver driver, CComputedString output, boolean keep800x600Ratio) {
    nel3dJNI.CFontManager_computeString__SWIG_0(swigCPtr, this, s, CFontGenerator.getCPtr(fontGen), fontGen, CRGBA.getCPtr(color), color, fontSize, IDriver.getCPtr(driver), driver, CComputedString.getCPtr(output), output, keep800x600Ratio);
  }

  public void computeString(String s, CFontGenerator fontGen, CRGBA color, long fontSize, IDriver driver, CComputedString output) {
    nel3dJNI.CFontManager_computeString__SWIG_1(swigCPtr, this, s, CFontGenerator.getCPtr(fontGen), fontGen, CRGBA.getCPtr(color), color, fontSize, IDriver.getCPtr(driver), driver, CComputedString.getCPtr(output), output);
  }

  public void computeString(SWIGTYPE_p_ucstring s, CFontGenerator fontGen, CRGBA color, long fontSize, IDriver driver, CComputedString output, boolean keep800x600Ratio) {
    nel3dJNI.CFontManager_computeString__SWIG_2(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(s), CFontGenerator.getCPtr(fontGen), fontGen, CRGBA.getCPtr(color), color, fontSize, IDriver.getCPtr(driver), driver, CComputedString.getCPtr(output), output, keep800x600Ratio);
  }

  public void computeString(SWIGTYPE_p_ucstring s, CFontGenerator fontGen, CRGBA color, long fontSize, IDriver driver, CComputedString output) {
    nel3dJNI.CFontManager_computeString__SWIG_3(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(s), CFontGenerator.getCPtr(fontGen), fontGen, CRGBA.getCPtr(color), color, fontSize, IDriver.getCPtr(driver), driver, CComputedString.getCPtr(output), output);
  }

  public void computeStringInfo(SWIGTYPE_p_ucstring s, CFontGenerator fontGen, CRGBA color, long fontSize, IDriver driver, CComputedString output, boolean keep800x600Ratio) {
    nel3dJNI.CFontManager_computeStringInfo__SWIG_0(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(s), CFontGenerator.getCPtr(fontGen), fontGen, CRGBA.getCPtr(color), color, fontSize, IDriver.getCPtr(driver), driver, CComputedString.getCPtr(output), output, keep800x600Ratio);
  }

  public void computeStringInfo(SWIGTYPE_p_ucstring s, CFontGenerator fontGen, CRGBA color, long fontSize, IDriver driver, CComputedString output) {
    nel3dJNI.CFontManager_computeStringInfo__SWIG_1(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(s), CFontGenerator.getCPtr(fontGen), fontGen, CRGBA.getCPtr(color), color, fontSize, IDriver.getCPtr(driver), driver, CComputedString.getCPtr(output), output);
  }

  public String getCacheInformation() {
    return nel3dJNI.CFontManager_getCacheInformation(swigCPtr, this);
  }

  public void dumpCache(String filename) {
    nel3dJNI.CFontManager_dumpCache(swigCPtr, this, filename);
  }

  public void invalidate() {
    nel3dJNI.CFontManager_invalidate(swigCPtr, this);
  }

}
